<?php
include("inc.php");
if($urlmodel==1)
{
	$urlstr=$_SERVER["REQUEST_URI"]==$_SERVER['SCRIPT_NAME']?"":str_replace($_SERVER['SCRIPT_NAME'],"",$_SERVER["REQUEST_URI"]);
	if($urlstr&&preg_match("/\/.*\/.*-([0-9]+).html/",$urlstr,$regs))
	{
		$_GET['aid']=$regs[1];
		unset($regs);
	}
	else die("sorry");
	unset($urlstr);
}
$aid=$_GET['aid'];
$rs=mysql_query("SELECT `article`.*,`content`.`content`,`word`.`word`,`word`.`pinyin` as `wordpinyin`  FROM `article` join `content` on `article`.`aid`=`content`.`aid` join `word` on `word`.`wid`=`article`.`wid` WHERE `article`.`aid` ={$aid} LIMIT 1");
$rw=@mysql_num_rows($rs)?mysql_fetch_assoc($rs):die("none");
$wid=$rw['wid'];
$word=$rw['word'];
$pinyin=$rw['wordpinyin'];

//echo $rw['description'];
//$rw['description']=htmlentities($rw['description']);
$rw['content']=str_replace($matcharray,$replacearray,$rw['content']);
$rw['content']=str_replace($word,"<a href=\"list.php/{$pinyin}/{$wid}-p1.html\">{$word}</a>",$rw['content']);



?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?=$rw['title']?></title>
<meta name="keywords" content="<?=$rw['title']?>" />
<meta name="description" content="<?=$rw['description']?><?=$sitedescription?>" />
<base href="<?=$baseurl?>">
<link href="main.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="main">
<div id="head">
<a href="./"><?=$sitename?></a>-<a href="wordlist.php/1/"><?=$sitenameadd?></a>
</div>
<div id="h">
  <div id="googlelink728X15">
  <script type="text/javascript"><!--
  google_ad_client = "pub-3493786795582708";
  google_ad_format = "js_sdo";
  google_cts_mode ="rs";
  google_num_cts = "2";
  google_searchbox_width = 215;
  google_searchbox_height = 26;
  google_link_target = 2;
  google_ad_channel = "6297994744";
  google_logo_pos = "left";
  google_rs_pos = "right";
  google_ad_height = 35;
  google_ad_width = 920;
//-->
</script>
<script type="text/javascript"
  src="http://pagead2.googlesyndication.com/pagead/show_sdo.js">
</script>

  </div>
</div>
<div style="height:90px;width:950px;margin:0 auto; margin-bottom:6px;margin-top:6px;">
<a href="http://www.51taonan.com/m/000234" rel="nofollow" target="_blank"><img src="http://www.51taonan.com/static/zh_cn/insidepage/market/default/images/staff/950_90.gif" border="0"/></a>
</div>
<div id="l">
<div id="view">
<div ><a href="./"><?=$sitename?></a> -> <a href="wordlist.php/1/"><?=$lang['alltopic']?></a> -> <a href="list.php/<?=$pinyin?>/<?=$wid?>-p1.html"><?=$word?></a> -> <?=$rw['title']?></div>
<h1><?=$rw['title']?></h1>
<div id="author"><?=$lang['time']?>:<?=$rw['pubtime']?></div>
<div id="description"><?=$lang['description']?>:<?=$rw['description']?></div>
<div id="google728x90">
<script type="text/javascript"><!--
google_ad_client = "pub-3493786795582708";
/* 728x90, ������ 09-12-14 */
google_ad_slot = "6503528725";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<div id="content"><?=$rw['author']?> said in his blog:<?=$rw['content']?></div>

<div ><?=$lang['thisarticle']?>:<b><?=$rw['title']?></b></div> 
<div ><?=$lang['author']?>:<?=$rw['author']?></div>
<div ><?=$lang['source']?>:<?=$rw['src']?></div>

<?php unset($rw);?>
<?php $rs=mysql_query("SELECT `aid`,`title`,`pinyin`,`author`,`description` FROM `article` WHERE `wid`={$wid} and  `aid` >{$aid} ORDER BY `aid` ASC LIMIT 1");
if(@mysql_num_rows($rs)){ $rw=mysql_fetch_assoc($rs);
?>
<div><?=$lang['nextarticle']?>:	</div>
<div>About the topic <?=$word?>, <?=$rw['author']?> said in his blog:<a href="view.php/<?=$pinyin?>/<?=$rw['pinyin']?>-<?=$rw['aid']?>.html"><?=$rw['title']?></a> like this :<br /><?=$rw['description']?></div>
<?}?>
<?php $rs=mysql_query("SELECT `aid`,`title`,`pinyin`,`author`,`description` FROM `article` WHERE `wid`={$wid} and `aid` <{$aid} ORDER BY `aid` DESC LIMIT 1");
if(@mysql_num_rows($rs)){ $rw=mysql_fetch_assoc($rs);
?>
<div><?=$lang['prearticle']?>:	</div>
<div>As the same but diffrent, talk about the topic <?=$word?>, <?=$rw['author']?> said in his blog:<a href="view.php/<?=$pinyin?>/<?=$rw['pinyin']?>-<?=$rw['aid']?>.html"><?=$rw['title']?></a> like this :<br /><?=$rw['description']?></div>
<?}?>

</div>
</div>
<div id="r">
<?php $i=rand(1,10);if(file_exists("smile/{$i}.jpg")){?>
<div id="pic"><img src="smile/<?=$i?>.jpg"></div>
<?}?>
<div id="google200X200">
<iframe scrolling="no" frameborder="0" marginheight="0" marginwidth="0" width="200" height="235" src="http://u.www.duba.net/union/db/style_1283.html?uid=41223&sid=0" id="ksu_style_1283"></iframe>
</div>
<div id="google200X200">
<script type="text/javascript"><!--
google_ad_client = "pub-3493786795582708";
/* 200x200, ������ 09-12-14 */
google_ad_slot = "4616496781";
google_ad_width = 200;
google_ad_height = 200;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<div id="w">
<?
$rs=mysql_query("SELECT `wid` , `word` , `pinyin` FROM `word` ORDER BY RAND() LIMIT 0 , 10");
if($rs)
{
	while ($rw=mysql_fetch_assoc($rs))
	{
?>
<a href="list.php/<?=$rw['pinyin']?>/<?=$rw['wid']?>-p1.html"><?=$rw['word']?></a>
<?
	}
}
?>
</div>
</div>
<?php include("footer.php");?>
<script type="text/javascript">
<!--
window.onload = function() {
    document.getElementById('content').innerHTML = document.getElementById('content').innerHTML.replace(/dh/gi, ',');
    document.getElementById('content').innerHTML = document.getElementById('content').innerHTML.replace(/jh/gi, '.');
}
//-->
</script>
